package database;

import java.util.Objects;

public class Item {
    private String title;
    private int playingTime;
    private boolean gotIt;
    private String comment;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Item item = (Item) o;
        return playingTime == item.playingTime && gotIt == item.gotIt && Objects.equals(title, item.title) && Objects.equals(comment, item.comment);
    }

    @Override
    public int hashCode() {
        return Objects.hash(title, playingTime, gotIt, comment);
    }

    public Item(String title, int playingTime, boolean gotIt, String comment) {
        this.title = title;
        this.playingTime = playingTime;
        this.gotIt = gotIt;
        this.comment = comment;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public void print() {
        System.out.print(title);
    }
}
